<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>生化危机：学校末日 - Zombie School Survival</title>
    <link rel="stylesheet" href="styles/game.css">
</head>
<body>
    <div id="gameContainer">
        <canvas id="gameCanvas" width="1000" height="750"></canvas>
        
        <!-- 游戏UI界面 -->
        <div id="gameUI">
            <div id="healthBar">
                <div class="bar-label">血量</div>
                <div class="health-bar-container">
                    <div id="healthBarFill" class="health-bar-fill"></div>
                </div>
                <span id="healthText">100/100</span>
            </div>
            
            <div id="weaponInfo">
                <div class="weapon-icon">🔫</div>
                <span id="ammoCount">30/90</span>
            </div>
            
            <div id="combatMode">
                <div class="combat-mode-label">战斗模式</div>
                <span id="combatModeDisplay">远程模式</span>
                <div class="combat-mode-hint">按Q键切换</div>
            </div>
            
            <div id="levelInfo">
                <span>关卡: <span id="currentLevel">1</span>/20</span>
            </div>
            
            <div id="score">
                <span>分数: <span id="scoreValue">0</span></span>
            </div>
        </div>
        
        <!-- 开始菜单 -->
        <div id="startMenu" class="menu">
            <h1>生化危机：学校末日</h1>
            <p>僵尸爆发，你被困在学校里。用你的枪击败所有僵尸，生存下去！</p>
            <button id="startButton" class="menu-btn">开始游戏</button>
            <button id="loadButton" class="menu-btn">继续游戏</button>
            <button id="levelSelectButton" class="menu-btn">关卡选择</button>
            <button id="saveManageButton" class="menu-btn">存档管理</button>
            <button id="achievementsButton" class="menu-btn">成就系统</button>
            <button id="upgradeStoreButton" class="menu-btn">永久升级商店</button>
            <button id="skillTreeButton" class="menu-btn">技能树</button>
            <div class="controls-info">
                <h3>操作说明：</h3>
                <p>WASD - 移动角色</p>
                <p>鼠标 - 瞄准射击/近战攻击</p>
                <p>空格 - 快速换弹 (1秒)</p>
                <p>Q - 切换战斗模式</p>
                <p>E - 捡起武器</p>
            </div>
        </div>
        
        <!-- 游戏结束菜单 -->
        <div id="gameOverMenu" class="menu hidden">
            <h2>游戏结束</h2>
            <p id="finalScore">最终分数: 0</p>
            <button id="restartButton" class="menu-btn">重新开始</button>
            <button id="mainMenuButton" class="menu-btn">返回主菜单</button>
        </div>
        
        <!-- 关卡完成菜单 -->
        <div id="levelCompleteMenu" class="menu hidden">
            <h2>关卡完成！</h2>
            <p id="levelScore">本关分数: 0</p>
            <button id="nextLevelButton" class="menu-btn">下一关</button>
            <button id="saveGameButton" class="menu-btn">保存游戏</button>
            <button id="menuButton" class="menu-btn">返回主菜单</button>
        </div>
        
        <!-- 存档管理菜单 -->
        <div id="saveManageMenu" class="menu hidden">
            <h2>存档管理</h2>
            <div id="saveSlots" class="save-slots"></div>
            <div class="save-controls">
                <button id="quickSaveBtn" class="menu-btn">快速保存</button>
                <button id="quickLoadBtn" class="menu-btn">快速加载</button>
                <button id="exportSaveBtn" class="menu-btn">导出存档</button>
                <input type="file" id="importSaveInput" accept=".json" style="display: none;">
                <button id="importSaveBtn" class="menu-btn">导入存档</button>
                <button id="saveManageBack" class="menu-btn">返回</button>
            </div>
        </div>
        
        <!-- 成就系统菜单 -->
        <div id="achievementsMenu" class="menu hidden">
            <h2>🏆 成就系统</h2>
            <div id="achievementStats" class="achievement-stats"></div>
            <div id="achievementGrid" class="achievement-grid"></div>
            <div class="achievement-controls">
                <button id="achievementsBack" class="menu-btn">返回主菜单</button>
            </div>
        </div>
        
        <!-- 永久升级商店菜单 -->
        <div id="upgradeStoreMenu" class="menu hidden">
            <h2>🏪 永久升级商店</h2>
            <div class="currency-display">
                <span class="currency-icon">💰</span>
                <span id="currencyAmount">0</span>
                <span class="currency-label">金币</span>
            </div>
            <div id="upgradeStoreGrid" class="upgrade-store-grid"></div>
            <div class="store-controls">
                <button id="upgradeStoreBack" class="menu-btn">返回主菜单</button>
            </div>
        </div>
        
        <!-- 技能树菜单 -->
        <div id="skillTreeMenu" class="menu hidden">
            <h2>🌳 技能树</h2>
            <div class="skill-info">
                <div class="skill-stats">
                    <span>经验: <span id="experienceDisplay">0</span></span>
                    <span>技能点: <span id="skillPointsDisplay">0</span></span>
                </div>
            </div>
            <div id="skillTreeContainer" class="skill-tree-container"></div>
            <div class="skill-tree-controls">
                <button id="skillTreeBack" class="menu-btn">返回主菜单</button>
                <button id="resetSkillsBtn" class="menu-btn danger-btn">重置技能</button>
            </div>
        </div>
    </div>
    

    <script>
        // 空的调试函数（不显示任何调试信息）
        window.debugLog = function() {};
        
        // 小型错误处理（不显示调试信息）
        window.addEventListener('error', (e) => {
            console.error('错误信息:', e.message, '文件:', e.filename, '行号:', e.lineno);
        });

        // 捕获未处理的Promise错误
        window.addEventListener('unhandledrejection', (e) => {
            console.error('Promise错误:', e.reason);
        });
    </script>
    
    <script src="js/gameEngine.js"></script>
    <script src="js/player.js"></script>
    <script src="js/zombie.js"></script>
    <script src="js/weapon.js"></script>
    <script src="js/boss.js"></script>
    <script src="js/boss-enhanced.js"></script>
    <script src="js/zombie-enhanced.js"></script>
    <script src="js/zombie-enhanced-fix.js"></script>
    <script src="js/ultimate-boss.js"></script>
    <script src="js/powerups.js"></script>
    <script src="js/level.js"></script>
    <script src="js/storage.js"></script>
    <script src="js/saveSystem.js"></script>
    <script src="js/levelSelect.js"></script>
    <script src="js/achievements-simple.js"></script>
    <script src="js/roguelike.js"></script>
    <script src="js/visualEffects.js"></script>
    <script src="js/skillTree-new.js"></script>
    <script src="js/weaponEnhancement.js"></script>
    <script src="js/roguelike-effects.js"></script>
    <script src="js/minimal-safe.js"></script>
    <script src="js/realistic-environment.js"></script>
    <script src="js/level10-balance-fix.js"></script>
    <script src="js/main.js"></script>
</body>
</html>